<template>
  <div>
    我是孙组件=={{v2}}
  </div>
</template>

<script>
import {inject}  from 'vue'
export default {
   inject:['v2'],
  setup () {
    
    const r=inject('rootMsg')
        console.log(r.value,'sun');
        return {}
      }
    }
</script>

<style lang="scss" scoped>

</style>